package api.doctor;

import java.io.IOException;

import org.json.JSONException;
import org.json.JSONObject;

import common.Host;
import common.Request;

/**
 * 实现帮忙医医生端上传聊天记录接口调用
 * @author gaowen
 *
 */
public class UploadMessage
{
	/**
	 * 实现帮忙医医生端上传聊天记录接口调用
	 * @param Message 消息内容
	 * @param FromUserID 发送者ID
	 * @param FromUserName 发送者姓名
	 * @param FromUserFace 发送者头像
	 * @param ToUserID 接受者ID
	 * @param MessageTime 消息时间
	 * @param CloudMessageID 云消息ID
	 * @param SubjectID 会话ID
	 * @param MessageType 消息类型
	 * @param isRead 是否已读
	 * @param token 调接口需要的token
	 * @return 接口返回值
	 * @throws JSONException
	 * @throws IOException
	 */
	public static String post(String Message,String FromUserID,String FromUserName,String FromUserFace,String ToUserID,String MessageTime,String CloudMessageID,String SubjectID,String MessageType,String isRead,String token) throws JSONException, IOException
	{
		String url=Host.getAddress()+"/api/IMmsgupload/UploadMessage";
		
		JSONObject parms=new JSONObject();
		parms.put("Message", Message);
		parms.put("FromUserID", FromUserID);
		parms.put("FromUserName", FromUserName);
		parms.put("FromUserFace", FromUserFace);
		parms.put("ToUserID", ToUserID);
		parms.put("MessageTime", MessageTime);
		parms.put("CloudMessageID", CloudMessageID);
		parms.put("SubjectID", SubjectID);
		parms.put("MessageType", MessageType);
		parms.put("isRead", isRead);
		
		String result=Request.post(url, parms, token);
		return result;
	}
}
